<?php

// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

/**
 * init.php
 *
 * @author: cnx7 <zysafe@live.cn> 2018-05-04
 */

if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Methods: *');
    header('Access-Control-Allow-Credentials: true');
    header('Access-Control-Allow-Headers: Content-Type,Access-Token');

    header('Content-Type: application/json');
    header('HTTP/1.1 204 No Content');
    return;
}
defined('ROOT_PATH') or define('ROOT_PATH', realpath(__DIR__ . '/..'));

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';

//$config = require __DIR__ . '/../config/web.php';


$config = require __DIR__ . '/../app/config/web.php';
/*print_r($config);

exit();*/

(new yii\web\Application($config))->run();